#ifndef shader_h
#define shader_h

#include <iostream>
#include <fstream>
#include <gl\glew.h>


namespace Dengine
{
	enum class type{ FRAGMENT_SHADER, VERTEX_SHADER }; //strongly typed and strongly scoped - C++11
	class Loadshader
	{
	public:
		Loadshader();
		~Loadshader();

		void LoadFromFile(const char* file, type shader);
		void LogError(){ fprintf(stderr, "%s", error); }
		GLuint ReturnProgram(){ return program; }
	private:
		void CompileShader(const char* buffer, const GLint buffer_length, type shader);
		bool CheckCompileError(GLuint Shader_type);
		bool LinkingError();

		char* error;
		GLuint program;
		
	};
}
#endif